/QUIET where { pop }{ (loading device.ps...\n)print } ifelse

DATA_DIR (/image.ps) strcat run  % image.ps implements device base classes
DATA_DIR (/nulldev.ps) strcat run  % nulldevice

%/newdefaultdevice load ==
newdefaultdevice % defined in xpost_interpreter.c:setlocalconfig()
                 % as similar to one of these:
%                /DEVICE 50 50 newPGMIMAGEdevice def
%loadxcbdevice   /DEVICE 400 300 newxcbdevice def
%loadwin32device /DEVICE 400 300 newwin32device def

%DEVICE {pop =} forall

DEVICE begin
    /defaultmatrix [ 1 0 0 -1 0 height ] def

    % override ps fillpoly with operator
    %/FillPoly load type /operatortype ne { % unless already overridden.
        /FillPoly /.fillpoly load def
    %} if
end

/flushpage {
    DEVICE /Flush known {
        DEVICE dup /Flush get exec
    } if
} bind def

/ShowpageSemanticsDict <<

    % XPOST_SHOWPAGE_DEFAULT
    0 {
        (----showpage----) =print flush
        [ {(%lineedit)(r)file}stopped cleartomark
        DEVICE /pagenumber
        2 copy known {
            2 copy get 1 add put
        }{
            1 put
        } ifelse
        erasepage
    } 

    % XPOST_SHOWPAGE_NOPAUSE
    1 {
        % don't do it.
        % do not pause right here.
    } 

    % XPOST_SHOWPAGE_RETURN
    2 {
        returntocaller
    } 
>> def

/showpage {
    DEVICE dup /Emit get exec

    ShowpageSemanticsDict ShowpageSemantics get exec
} bind def

/copypage {
    DEVICE dup /Emit get exec
    flushpage 

    (----copypage----) =print flush
    [ {(%lineedit)(r)file}stopped cleartomark

} bind def

/QUIET where { pop }{ (eof device.ps\n)print } ifelse
